package com.yoomiito.app.utils.video

import android.media.MediaPlayer

class MediaPlayerVideoInfo(mUrl: String) :VideoInfoUtil{
    private val mediaPlayer = MediaPlayer()

    init {
            mediaPlayer.setDataSource(mUrl)
            mediaPlayer.prepare()
    }

    override fun getVideoDuration(): String = mediaPlayer.duration.toString()

    override fun getVideoWidth(): String = mediaPlayer.videoWidth.toString()

    override fun getVideoHeight(): String = mediaPlayer.videoHeight.toString()

    override fun release() {
        mediaPlayer.release()
    }

}